package com.huawei.appgallery.forum.cards.card;

import android.content.Context;
import android.view.View;
import android.view.ViewStub;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageView;
import com.huawei.appgallery.forum.cards.bean.ForumHotSpotBloodCardBean;
import com.huawei.appgallery.forum.cards.bean.ForumHotSpotCardBean;
import o.azb;
import o.bsy.a;
import o.bsy.c;
import o.cgz;
import o.eqx;

public class ForumHotSpotBloodCard extends ForumHotSpotCard {
    private ImageView ʻ = null;
    private ForumHotSpotBloodCardBean ʽ;
    private FrameLayout ˊ = null;
    private Context ˋ;
    private ViewStub ˏ;

    public ForumHotSpotBloodCard(Context context) {
        super(context);
        this.ˋ = context;
    }

    public cgz ˏ(View view) {
        return super.ˏ(view);
    }

    protected void ˎ() {
        int ॱ = (azb.ॱ(this.ˋ) - (ᐝ() * 2)) / ʽ();
        ((LayoutParams) this.ˎ.getLayoutParams()).setMargins(0, ((int) (((double) ॱ) / 1.4545454545454546d)) - ((int) (((double) ॱ) / 1.7777777777777777d)), 0, 0);
    }

    protected void ˊ(View view) {
        super.ˊ(view);
        this.ˏ = (ViewStub) view.findViewById(c.ˊˊ);
        this.ˊ = (FrameLayout) this.ˏ.inflate();
        this.ʻ = (ImageView) this.ˊ.findViewById(c.ͺˎ);
    }

    protected void ॱ(ForumHotSpotCardBean forumHotSpotCardBean) {
        super.ॱ(forumHotSpotCardBean);
        if (forumHotSpotCardBean instanceof ForumHotSpotBloodCardBean) {
            this.ʽ = (ForumHotSpotBloodCardBean) forumHotSpotCardBean;
            int ॱ = azb.ॱ(this.ˋ) - (ᐝ() * 2);
            String ˊ = this.ʽ.ˊ();
            int ʽ = ॱ / ʽ();
            int i = (int) (((double) ʽ) / 1.4545454545454546d);
            LayoutParams layoutParams = (LayoutParams) this.ʻ.getLayoutParams();
            layoutParams.width = ʽ;
            layoutParams.height = i;
            this.ʻ.setLayoutParams(layoutParams);
            this.ʻ.setTag(this.ʽ);
            eqx.ॱ(this.ʻ, ˊ, a.ॱᐝ);
        }
    }

    protected void ʻ() {
        ॱ(this.ॱ);
    }
}
